#include "./letter_shell/shell.h"
#include "./motor/motor.h"
#include "./gray/gray.h"
#include "./encorder/encorder.h"
#include "debug_gpio.h"
#include "user_led.h"
#include "user_beep.h"
#include "debug_pid.h"
#include "imu/imu.h"

/*将触发声光提示功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					sound_light, sound_light_start, sound light prompt trig);

/*将打开led功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					led_open, led_set, open the led);
			
/*将关闭led功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					led_close, led_reset, close the led);

/*将打开蜂鸣器功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					beep_open, beep_set, open the beep);
			
/*将关闭蜂鸣器功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					beep_close, beep_reset, close the beep);

/*将设置右电机pwm值功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					r_motor_pwm, r_motor_pwm_set, set the pwm ccr of right motor);

/*将设置左电机pwm值功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					l_motor_pwm, l_motor_pwm_set, set the pwm ccr of left motor);

/*将打开电机测速中断功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					encorder_open, motor_speed_measure_int_enable, open the motor encorder interrupt);

/*将关闭电机测速中断功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					encorder_close, motor_speed_measure_int_disable, close the motor encorder interrupt);

/*将灰度扫描功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					gray_update, gray_scan, update the gray data);

/*将读出最近的灰度数据功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					gray_data,gray_get_data, get gray data);

/*将设置pid目标值功能导出至命令*/
SHELL_EXPORT_CMD_AGENCY(SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC),
					pid_set_target, debug_pid_set_target, set the target of pid object,
					p1, SHELL_PARAM_FLOAT(p2));

/*将设置pid参数功能导出至命令*/
SHELL_EXPORT_CMD_AGENCY(SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC),
					pid_set_argument, debug_pid_set_argut, set the argument of pid object,
					p1, SHELL_PARAM_FLOAT(p2), SHELL_PARAM_FLOAT(p3), SHELL_PARAM_FLOAT(p4));

/*将pid显参功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					pid_show_argument, debug_pid_show_argut, show the argument of pid object);

/*将角度环pid开关功能导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					angle_pid_set, angle_pid_switch, open orr close the angle pid);

/*将IMU初始化导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					imu_init, imu_init, init imu);

/*将IMU更新数据导出至命令*/
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
					imu_update, imu_update, update imu data);
					
// /*将IMU读取数据功能导出至命令*/
// SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), 
// 					imu_read, imu_read_test, get imu data);